<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>初心-注册</title>
		<meta name="description" content="" />
		<meta name="author" content="胡 毅鹏" />
		<!--[if lt IE 9]>
			<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
		<link rel="shortcut icon" href="/favicon.ico" />
        <link rel="stylesheet" href="{{ STATIC_URL }}css/reset.css" type="text/css" media="screen" />
        <link rel="stylesheet" href="{{ STATIC_URL }}css/grid.css" type="text/css" media="screen" />
        <link rel="stylesheet" href="{{ STATIC_URL }}css/master.css" type="text/css" media="screen" />
	</head>
	<body>
		<div>
			<header>
				<div class="container_12">
                    <h1><a href="{%url index %}">初  心</a></h1>
					<nav id="mainNav" >
                    <a href="{% url index %}">首页</a>
						<a href="#">交易墙</a>
						<a href="#">图书库</a>
						<a href="#">讨论区</a>
					</nav>
					<form action="/search" method="">
						<input type="text" class="search-query" placeholder="搜索" />
					</form>
					<nav id="sideNav" class="gird_3">
                    <a href="{% url login_page %}">登录</a>
						<a href="#" class="selected">注册</a>
					</nav>
	
				</div>
			</header>
			<div class="container_12">
				<div class="grid_8 mainside">
					<div class="loginbox">
			    		<div class="loginheader">
			    			<h3>注册</h3>
			    		</div>
			    		<form id="reg_form" class="signinmain" method="post" action="">
                            {% csrf_token %}
                            {% for field in form %}
                            <p>
                            {% if field.label == "个人主页" %}
                            <label>{{ field.label }}</label>
                            {{ field }}
                            <span style="font-size: 12px; color:#FE2617;">不要忘了http://</span>
                            {% else %}
                            <label>{{ field.label }}</label>
                            {{ field }}

                            {% endif %}
                            </p>
                            {% endfor %}
                            {{ form.email.errors }}
                            <p class="signbtn">
                            <input type="submit" value="注册" class="btn-submit" />
                            </p>
			    		</form>
			    	</div>
					<div class="wallpanel">
					</div>
			    </div>
			    <div class="grid_4 sidebar">
			     	<div class="communityinfo">
			    		<p>分享即是快乐，探索亦是青春。</p><br />
			    		<p>既然都在外面看了这么久了，何不进来坐坐？歇个脚，留个言，生活就是这样！</p><br />
                        <p>> 若你已注册，请<a href="{% url login_page %}">登录</a></p>
			    	</div>
			    </div>
			    <div class="clearfix" />
			</div>
			
			<footer class="container_12">
				<nav class="footinfo">
					<a href="#">关于</a>
					<span>·</span>
					<a href="#">联系</a>
					<span>·</span>
					<a href="#">反馈</a>
					<span>&copy;2012 chuxin.me</span>
				</nav>
			</footer>
		</div>
		
		<script src="http://lib.sinaapp.com/js/jquery/1.7/jquery.js" type="text/javascript"></script>		
        <script src="{{ STATIC_URL }}js/jquery.validate.js" type="text/javascript"></script>
		<script type="text/javascript">
			$().ready(function() {
				$("#reg_form").validate({
					rules: {
						email: {
							required: true,
							email: true
						},
						password: {
							required: true,
							minlength: 5
						},
						confirm_password: {
							required: true,
                            minlength: 5,
                            equalTo:"#id_password"
                            },
						username: {
							required: true,
							maxlength: 14
						}
					},
					messages: {
						email: "哎呦，请输入有效邮箱地址",
						password: {
							required: "请输入密码",
							minlength: "密码太寒碜了，需要5个字符以上"
						},
		                confirm_password: {
							required: "请输入密码",
							minlength: "密码太寒碜了，需要5个字符以上",
							equalTo: "两次输入不一致，请检查"
						},
						username: {
							required:"那个谁，填个昵称吧",
							maxlength: "你的昵称也太长了吧，记不住啊"
						}
					}
				});
			}); 	
		</script>
	</body>
</html>

